<?php

class AccountController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }
    
    /**
    * Process the account form
    *
    */

    public function successAction()
    {
        if ($this->_request->isPost()) {
            $email = $this->_request->getPost('email');
            $username = $this->_request->getPost('username');
            $password = $this->_request->getPost('password');

            require_once "SaveAccount.php";

            $SaveAccount = new SaveAccount();
            $SaveAccount->saveAccount($username, $password, $email);
            
        } else {
            throw new Exception('Wrong way to submit data');
        }
    }

    /*    
    * Display the form for signing up.
    *
    */
    public function newAction()
    {
        // action body
    }
    
    /*
    * Activate Account. Used once the user
    * receives a welcome email and decides to authenticate
    * their account.
    *
    */
    public function activateAction()
    {
        $emailToActivate = $this->_request->getQuery('email');
    }


}







